package com.jinghua.treatment.wechat.entity;

import java.util.Date;

public class TextXML extends ResponseXML{
    private String Content;
    private String MsgId;

    public TextXML(){}

    public TextXML(String toUserName, String fromUserName, String createTime, String msgType, String content, String msgId) {
        ToUserName = toUserName;
        FromUserName = fromUserName;
        CreateTime = createTime;
        MsgType = msgType;
        Content = content;
        MsgId = msgId;
    }

    public TextXML(String toUserName, String fromUserName, String content) {
        ToUserName = toUserName;
        FromUserName = fromUserName;
        Content = content;
    }

    public String getToUserName() {
        return ToUserName;
    }

    public void setToUserName(String toUserName) {
        ToUserName = toUserName;
    }

    public String getFromUserName() {
        return FromUserName;
    }

    public void setFromUserName(String fromUserName) {
        FromUserName = fromUserName;
    }

    public String getCreateTime() {
        return CreateTime;
    }

    public void setCreateTime(String createTime) {
        CreateTime = createTime;
    }

    public String getMsgType() {
        return MsgType;
    }

    public void setMsgType(String msgType) {
        MsgType = msgType;
    }

    public String getContent() {
        return Content;
    }

    public void setContent(String content) {
        Content = content;
    }

    public String getMsgId() {
        return MsgId;
    }

    public void setMsgId(String msgId) {
        MsgId = msgId;
    }

    /**
     * 组装回复用的文本消息
     * @return
     */
    public String xml(){
        return "<xml><ToUserName><![CDATA["+this.ToUserName+"]]></ToUserName><FromUserName><![CDATA["+this.FromUserName+"]]>" +
                "</FromUserName><CreateTime>"+new Date().getTime()+"</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA["+this.Content+"]]>" +
                "</Content></xml>";
    }
}
